<?php
## DELETE CACHE ################################################################
function delete_cache($file, $force = FALSE) {
	$base =& Base::getInstance();

	if ($file == 'config') unset($_SESSION['lf']['queries']['config']);
	if ($file == 'common') unset($_SESSION['lf']['queries']['common']);
	if ($file == 'permissions') unset($_SESSION['lf']['queries']['permissions']);
	if ($file == 'roles') unset($_SESSION['lf']['queries']['roles']);

	if ($base->config['sql_cache_enabled'] == 0 && !$force) return FALSE;

	if (file_exists('cache/'.$file.'.cache')) {
		return (unlink('cache/'.$file.'.cache') ? TRUE : FALSE);
	}
}

## CHECK CACHE #################################################################
function check_cache($file) {
	return (file_exists('cache/'.$file.'.cache') ? TRUE : FALSE);
}
?>